<template>
  <div class="swiper">
    <swiper :options="swiperOption">
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl">
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
  export default {
    name: 'HomeSwiper',
    data () {
      return {
        swiperOption: {
          pagination: '.swiper-pagination',
          loop :true
        },
        swiperList:[{
          id:'001',
          imgUrl:'http://qidian.qpic.cn/qidian_common/349573/eb79dd78b3d7e0b3eecb80a80317925d/0'
        },{
          id:'002',
          imgUrl:'http://qidian.qpic.cn/qidian_common/349573/8987983b915292b1b14d8092e2b4eae3/0'
        },{
          id:'003',
          imgUrl:'http://qidian.qpic.cn/qidian_common/349573/c3e154d703b8f2c3a72f060e385bfb89/0'
        },{
          id:'004',
          imgUrl:'http://qidian.qpic.cn/qidian_common/349573/d5ab755f5f0c248c53e51eeaa5efa8e5/0'
        }]
      }
    }
  }
</script>

<style lang="stylus" scoped>
  .swiper  >>> .swiper-pagination-bullet-active
    background :#ccc
  .swiper
    overflow:hidden
    width:100%
    height:0
    padding-bottom: 30%
    background :#ccc
    .swiper-img
      width :100%
</style>
